simplifying algebraic fractions